package com.aruba.processdaemonapplication;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.Process;
import android.support.annotation.Nullable;
import android.util.Log;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by aruba on 2020/5/20.
 */
public class ProcessService extends Service {
    public final static String TAG = "aruba";
    int i=0;
    
    static {
        System.loadLibrary("native-lib");
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Wathcer wathcer = new Wathcer();
        wathcer.startDaemon(Process.myUid());

        Timer timer = new Timer();
        //定时器
        timer.scheduleAtFixedRate(
                new TimerTask() {
                    public void run() {
                        Log.i(TAG, "服务  " + i);
                        i++;
                    }
                }, 0, 1000 * 3);
    }
}
